FROM golang:1.17
ADD ./ /go/src/rlhs/
WORKDIR /go/src/rlhs
RUN go env -w GOPROXY=https://proxy.golang.com.cn,https://goproxy.cn,direct
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app .

FROM alpine:latest
MAINTAINER zjd
WORKDIR /app/
COPY --from=0 /go/src/rlhs/app ./rlhs
COPY --from=0 /go/src/rlhs/defaultConf/ ./configs/
VOLUME ["/app/configs/conf","/app/configs/secret"]
EXPOSE 80
ENTRYPOINT ["./rlhs"]